// @ts-nocheck
import { createRouter, createWebHistory } from 'vue-router'

import index from './components/index.vue'
import admin_home from './components/admin_home.vue'
import admin_about from './components/admin_about.vue'

import goods_home from './components/goods_home.vue'
import goods_about from './components/goods_about.vue'

// 创建路由实例对象
const router = createRouter({
    history: createWebHistory(),
    routes: [
        {path:'/',name:'index',component:index,redirect:'/admin',
            children:[
                { path: '/admin', name:'admin',redirect:'/admin/home',meta:{desc:'首页'},
                    children:[
                        {path:'/admin/home',name:'admin_home',component:admin_home,meta:{desc:'首页管理'}},
                        {path:'/admin/about',name:'admin_about',component:admin_about,meta:{desc:'首页关于'}},
                    ],
                },
                { path: '/goods', name:'goods',redirect:'/goods/home',meta:{desc:'商品管理'},
                    children:[
                        {path:'/goods/home',name:'goods_home',component:goods_home,meta:{desc:'商品首页'}},
                        {path:'/goods/about',name:'goods_about',component:goods_about,meta:{desc:'商品关于'}},
                    ],
                },
            ]},
    ],
})

export default router
